package com.assignwork.mapper;

import com.assignwork.dto.VoyageBillCabinSearchDTO;
import com.assignwork.vo.BillAllCabinPageVO;
import com.assignwork.vo.StartedCabinVO;
import com.assignwork.vo.VoyageBillCabinSimpleVO;
import com.assignwork.vo.VoyageBillSplitCabinPageVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.assignwork.entity.VoyageBillCabin;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * 舱图Mapper
 */
public interface VoyageBillCabinMapper extends BaseMapper<VoyageBillCabin> {

    /**
     * 进口舱单信息分页
     * @param dto 搜索条件
     * @param page 分页
     * @return List<BillAllCabinPageVO>
     * @author dujianyu
     * @since 2023/8/24 10:18
     */
    List<BillAllCabinPageVO> selectImpBillInfo(VoyageBillCabinSearchDTO dto, IPage page);

    /**
     * 出口舱单信息分页
     * @param dto 搜索条件
     * @param page 分页
     * @return List<BillAllCabinPageVO>
     * @author dujianyu
     * @since 2023/8/24 10:18
     */
    List<BillAllCabinPageVO> selectExpBillInfo(VoyageBillCabinSearchDTO dto, IPage page);

    /**
     * 票分页
     * @param dto 搜索参数
     * @param page 分页
     * @return  List<VoyageBillCabinSimpleVO>
     * @author dujianyu
     * @since 2023/8/25 14:23
     */
    List<VoyageBillCabinSimpleVO> selectVoyageBillCabinBillList(VoyageBillCabinSearchDTO dto, IPage page);

    /**
     * 分舱分页
     * @param dto 搜索参数
     * @param page 分页
     * @return List<VoyageBillSplitCabinPageVO>
     * @author dujianyu
     * @since 2023/8/25 16:20
     */
    List<VoyageBillSplitCabinPageVO> selectVoyageBillSpiltCabinList(VoyageBillCabinSearchDTO dto, IPage page);

    /**
     * 理货吨
     * @param dto 搜索参数
     * @return BigDecimal
     * @author dujianyu
     * @since 2024/1/16 15:32
     */
    BigDecimal getTallyTon(@Param("dto") VoyageBillCabinSearchDTO dto);

    List<StartedCabinVO> cabinTonByShip(@Param("shipId") Long shipId, @Param("voyageNo") String voyageNo);

}